<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Dolby Vision Content Editing for Third-Party Developers: BuilderCodecTemplate.java Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="dlb_stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Dolby Vision Content Editing for Third-Party Developers
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('a00011_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">BuilderCodecTemplate.java</div></div>
</div><!--header-->
<div class="contents">
<a href="a00011.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/******************************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * The Clear BSD License</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> * Copyright (c) 2023 Dolby Laboratories</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * All rights reserved.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> *</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment"> * modification, are permitted (subject to the limitations in the disclaimer</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"> * below) provided that the following conditions are met:</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment"> *   - Redistributions of source code must retain the above copyright notice,</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment"> *     this list of conditions and the following disclaimer.</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment"> *   - Redistributions in binary form must reproduce the above copyright notice,</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment"> *     this list of conditions and the following disclaimer in the documentation</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment"> *     and/or other materials provided with the distribution.</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="comment"> *   - Neither the name of Dolby Laboratories nor the names of its contributors</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="comment"> *     may be used to endorse or promote products derived from this software</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment"> *     without specific prior written permission.</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="comment"> *</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="comment"> * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY&#39;S PATENT RIGHTS ARE GRANTED BY</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment"> * THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="comment"> * CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="comment"> * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="comment"> * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="comment"> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="comment"> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="comment"> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="comment"> * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="comment"> ******************************************************************************/</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="a00023.html">   32</a></span><span class="keyword">package </span>com.dolby.vision.codecselection;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="keyword">import</span> android.media.MediaCodec;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="keyword">import</span> android.os.Bundle;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="a00032.html">   40</a></span><span class="keyword">public</span> <span class="keyword">abstract</span> <span class="keyword">class </span><a class="code hl_class" href="a00032.html">BuilderCodecTemplate</a> <span class="keyword">extends</span> MediaCodec.Callback {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="a00032.html#a6d1352c114277b68f4ac9b4717f6470f">   45</a></span>    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> String <a class="code hl_variable" href="a00032.html#a6d1352c114277b68f4ac9b4717f6470f">VENDOR_DOLBY_CODEC_TRANSFER_PARAMKEY</a> = <span class="stringliteral">&quot;vendor.dolby.codec.transfer.value&quot;</span>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="a00032.html#a6924758e43cebaa67f154ad3505b1f8b">   50</a></span>    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> String[] <a class="code hl_variable" href="a00032.html#a6924758e43cebaa67f154ad3505b1f8b">TRANSFER_PARAMS</a> = {<span class="stringliteral">&quot;transfer.sdr.normal&quot;</span>, <span class="stringliteral">&quot;transfer.sdr.high.fidelity&quot;</span>, <span class="stringliteral">&quot;transfer.hlg&quot;</span>, <span class="stringliteral">&quot;transfer.dolby&quot;</span>};</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">   52</a></span>    <span class="keyword">private</span> MediaCodec <a class="code hl_variable" href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">codec</a>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="a00032.html#a2bc24b6188d75a9930a456cc4aeb6868">   59</a></span>    <span class="keyword">public</span> <span class="keyword">final</span> MediaCodec <a class="code hl_function" href="a00032.html#a2bc24b6188d75a9930a456cc4aeb6868">getCodec</a>() {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        <span class="keywordflow">return</span> <a class="code hl_variable" href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">codec</a>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    }</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="a00032.html#af7cc14274238caf8338243726572f62b">   68</a></span>    <span class="keyword">public</span> <span class="keyword">final</span> <span class="keywordtype">void</span> <a class="code hl_function" href="a00032.html#af7cc14274238caf8338243726572f62b">createCodec</a>(MediaCodec <a class="code hl_variable" href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">codec</a>) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>        this.codec = <a class="code hl_variable" href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">codec</a>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="a00032.html#adf4014b0ea74869169ba809f87c4e38b">   77</a></span>    <span class="keyword">public</span> <span class="keyword">final</span> <span class="keywordtype">void</span> <a class="code hl_function" href="a00032.html#adf4014b0ea74869169ba809f87c4e38b">setTransfer</a>(String transfer) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>        <span class="keywordflow">if</span> (this.<a class="code hl_function" href="a00032.html#a2bc24b6188d75a9930a456cc4aeb6868">getCodec</a>() != <span class="keyword">null</span>) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>            Bundle transferBundle = <span class="keyword">new</span> Bundle();</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>            transferBundle.putString(<a class="code hl_variable" href="a00032.html#a6d1352c114277b68f4ac9b4717f6470f">VENDOR_DOLBY_CODEC_TRANSFER_PARAMKEY</a>, transfer);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            this.<a class="code hl_function" href="a00032.html#a2bc24b6188d75a9930a456cc4aeb6868">getCodec</a>().setParameters(transferBundle);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>        }</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    }</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>}</div>
<div class="ttc" id="aa00032_html"><div class="ttname"><a href="a00032.html">com.dolby.vision.codecselection.BuilderCodecTemplate</a></div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00040">BuilderCodecTemplate.java:40</a></div></div>
<div class="ttc" id="aa00032_html_a2bc24b6188d75a9930a456cc4aeb6868"><div class="ttname"><a href="a00032.html#a2bc24b6188d75a9930a456cc4aeb6868">com.dolby.vision.codecselection.BuilderCodecTemplate.getCodec</a></div><div class="ttdeci">final MediaCodec getCodec()</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00059">BuilderCodecTemplate.java:59</a></div></div>
<div class="ttc" id="aa00032_html_a4087c1c5b90a1d16270c93062e8cfe87"><div class="ttname"><a href="a00032.html#a4087c1c5b90a1d16270c93062e8cfe87">com.dolby.vision.codecselection.BuilderCodecTemplate.codec</a></div><div class="ttdeci">MediaCodec codec</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00052">BuilderCodecTemplate.java:52</a></div></div>
<div class="ttc" id="aa00032_html_a6924758e43cebaa67f154ad3505b1f8b"><div class="ttname"><a href="a00032.html#a6924758e43cebaa67f154ad3505b1f8b">com.dolby.vision.codecselection.BuilderCodecTemplate.TRANSFER_PARAMS</a></div><div class="ttdeci">static final String[] TRANSFER_PARAMS</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00050">BuilderCodecTemplate.java:50</a></div></div>
<div class="ttc" id="aa00032_html_a6d1352c114277b68f4ac9b4717f6470f"><div class="ttname"><a href="a00032.html#a6d1352c114277b68f4ac9b4717f6470f">com.dolby.vision.codecselection.BuilderCodecTemplate.VENDOR_DOLBY_CODEC_TRANSFER_PARAMKEY</a></div><div class="ttdeci">static final String VENDOR_DOLBY_CODEC_TRANSFER_PARAMKEY</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00045">BuilderCodecTemplate.java:45</a></div></div>
<div class="ttc" id="aa00032_html_adf4014b0ea74869169ba809f87c4e38b"><div class="ttname"><a href="a00032.html#adf4014b0ea74869169ba809f87c4e38b">com.dolby.vision.codecselection.BuilderCodecTemplate.setTransfer</a></div><div class="ttdeci">final void setTransfer(String transfer)</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00077">BuilderCodecTemplate.java:77</a></div></div>
<div class="ttc" id="aa00032_html_af7cc14274238caf8338243726572f62b"><div class="ttname"><a href="a00032.html#af7cc14274238caf8338243726572f62b">com.dolby.vision.codecselection.BuilderCodecTemplate.createCodec</a></div><div class="ttdeci">final void createCodec(MediaCodec codec)</div><div class="ttdef"><b>Definition:</b> <a href="a00011_source.html#l00068">BuilderCodecTemplate.java:68</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.1-->
<!-- start footer part -->
<!-- This div is not default but moves the footer to the bottom of the page. -->
<div id="footer">
	<div id="nav-path" class="navpath">
		<!-- id is needed for treeview function! -->
		<ul>
			<li class="logo"><a href="https://www.dolby.com"> <svg
						version="1.1" id="Logo" xmlns="http://www.w3.org/2000/svg"
						xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
						viewBox="0 0 380 118.8"
						style="vertical-align: middle; fill: white;" xml:space="preserve"
						height="3em">
						<use href="#LogoPath" />
						</svg></a></li> <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_541eb0a6c58a7690acc5b848a4b1b724.html">com</a></li><li class="navelem"><a class="el" href="dir_e1fe89baa560fcebb3ea3f0a9b5bf1d1.html">dolby</a></li><li class="navelem"><a class="el" href="dir_924ebb8219b2ed0e75643881d8c548ab.html">vision</a></li><li class="navelem"><a class="el" href="dir_3e5ffab4866963eb4c66afc3f386b275.html">codecselection</a></li><li class="navelem"><a class="el" href="a00011.html">BuilderCodecTemplate.java</a></li>
			<li class="footer">Generated on Wed Feb 15 2023 17:10:00 for Dolby Vision Content Editing for Third-Party Developers by&nbsp;Dolby Laboratories.<br>Confidential
				Information. &#169; 2011-2021 Dolby Laboratories, &#169; 2011-2021
				Dolby International AB. All rights reserved.
			</li>
		</ul>
	</div>
</div>
<svg style="display: none">
    <path id="LogoPath"
		d="M4.6,12.5h10.6c19.8,0,36,16.2,36,36s-16.2,36-36,36H4.6V12.5z
          M107,12.5H96.4c-19.8,0-36,16.2-36,36
          s16.2,36,36,36H107V12.5z
          M190.8,48.5c0,19.9-16.1,36-36,36h-26v-72h26C174.6,12.5,190.8,28.6,190.8,48.5z
          M179.9,48.5
          c0-13.8-11.3-25.1-25.1-25.1h-15.1v50.2h15.1C168.6,73.6,179.9,62.3,179.9,48.5z
          M246.2,59.6c0,13.8-11.2,25-25,25s-25-11.2-25-25
          s11.2-25,25-25S246.2,45.9,246.2,59.6z
          M236.3,59.5c0-8.2-6.8-15-15-15s-15,6.7-15,15c0,8.2,6.7,15,15,15
          C229.5,74.6,236.3,67.9,236.3,59.5z
          M253.3,84.5h10.9v-72h-10.9V84.5z
          M323.5,59.6c0,13.8-11.2,25-25,25c-5.3,0-10.2-1.7-14.3-4.5
          v4.4h-10.9v-72h10.9v26.7c4-2.8,9-4.5,14.3-4.5C312.3,34.7,323.5,45.9,323.5,59.6z
          M313.6,59.5c0-8.2-6.8-15-15-15
          c-6.6,0-12.3,4.3-14.3,10.3c-0.5,1.5-0.8,3.1-0.8,4.8c0,1.6,0.3,3.2,0.8,4.7c2,6,7.6,10.3,14.3,10.3
          C306.8,74.6,313.6,67.9,313.6,59.5z
          M363.5,34.7l-14.2,32l-14.2-32h-11.9l20.2,45.4c0,0-4.9,11.1-5,11.1c-1.3,2.9-4.8,4.3-7.7,3
          l-1.6-0.7l-4.4,9.9l0,0l0,0l0,0l3.8,1.7c7.1,3.2,15.5,0,18.6-7.2c0-0.1,25.8-57.8,28.3-63.2L363.5,34.7L363.5,34.7z" />
</svg>
</body>
</html>